package com.zhl.study.controller;

import com.zhl.study.base.ResponseFactory;
import com.zhl.study.base.Result;
import com.zhl.study.service.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zl
 * @date 2023/8/29 17:16
 */
@RestController
@RequestMapping("api/")
@Api(value = "参数校验", tags = "参数校验")
public class UserController {

    @Autowired
    IUserService iUserService;

    @PostMapping("/sign")
    @ApiOperation(httpMethod = "POST", value = "签到")
    public Result<Void> sign(){
        iUserService.sign();
        return ResponseFactory.ok();
    }

    @GetMapping("/signCount")
    @ApiOperation(httpMethod = "GET", value = "统计签到")
    public Result<Integer> signCount(){
        return ResponseFactory.ok(iUserService.signCount());
    }
}
